<template>
<div>
    <Table  :columns="columns" :data="data" border  width="800"></Table>
</div>
</template>

<script>    import {
    Table
} from 'iview'

    export default {
        name: "Tabletest",
        data(){
            return{
                columns:[
                    {
                        title:"",
                        key:"num",
                        width: 100,
                        fixed: 'left',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'text',
                                        size: 'small'
                                    }
                                }, 'View'),
                                h('Button', {
                                    props: {
                                        type: 'text',
                                        size: 'small'
                                    }
                                }, 'Edit')
                            ]);
                        }
                    },
                    {
                        title:"name",
                        key:"name",
                        width: 100,
                        fixed: 'left'

                    },
                    {
                        title:"name",
                        key:"name",
                        width: 100,
                    },
                    {
                        title:"name",
                        key:"name",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width:100
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },
                    {
                        title:"age",
                        key:"age",
                        width: 100,
                    },



                    {
                        title:"sex",
                        key:"sex",
                        width:100,
                        fixed:'right'
                    },

                ],
                data:[
                    {
                        num:"点击",
                        name:"张三",
                        age:"21",
                        sex:"男",
                        data:"2018.01.10",
                    },
                    {
                        name:"李四",
                        age:"26",
                        sex:"男",
                        data:"2018.01.10"
                    },
                    {
                        name:"王二",
                        age:"27",
                        sex:"男",
                        data:"2018.01.10"
                    },
                    {
                        name:"王芳",
                        age:"27",
                        sex:"女",
                        data:"2018.01.10"
                    },

                ]
            }

        },
        components:{
            Table
        }
    }
</script>

<style scoped>


</style>
